from django.db import models

# Create your models here.
from django.db import models


class City(models.Model):
    name = models.CharField(max_length=255, unique=True)

    def __str__(self):
        return self.name


class Datacenter(models.Model):
    name = models.CharField(max_length=255, unique=True)
    city_name = models.CharField(max_length=255)

    def __str__(self):
        return self.name


class Host(models.Model):
    city_name = models.CharField(max_length=255)
    hostname = models.CharField(max_length=255)
    datacenter_name = models.CharField(max_length=255)
    root_password = models.CharField(max_length=255)

    def __str__(self):
        return self.hostname


class HostCount(models.Model):
    city_name = models.CharField(max_length=255)
    datacenter_name = models.CharField(max_length=255)
    host_count = models.IntegerField()
    publication_date = models.DateField(null=True, blank=True)
